From a948d5c0c0df3cc60242ce853bc1a62c63439afd Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Thu, 16 Nov 2006 11:11:17 +0000 Subject: [PATCH] Fix clobbering bug when hde is specified; QEMU only supports up to hdd, but hde is accepted and writes off the end of some tables. From Hiromichi Itou . Signed-off-by: Ewan Mellor --- tools/ioemu/xenstore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ioemu/xenstore.c b/tools/ioemu/xenstore.c index 6c2bc9182a..21a8ed08b7 100644 --- a/tools/ioemu/xenstore.c +++ b/tools/ioemu/xenstore.c @@ -100,7 +100,7 @@ void xenstore_parse_domain_config(int domid) if (strncmp(dev, "hd", 2) || strlen(dev) != 3) continue; hd_index = dev[2] - 'a'; - if (hd_index > MAX_DISKS) + if (hd_index >= MAX_DISKS) continue; /* read the type of the device */ if (pasprintf(&buf, "%s/device/vbd/%s/device-type", path, e[i]) == -1) -- 2.30.2